/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ortustve.media.fanart;

import ortustve.Ortus;

/**
 *
 * @author jphipps
 */
public class FanartFactory {

    private static FanartFactory INSTANCE;
    public IFanartProvider FAProvider;

    public enum FFType { DB, Pheonix };

    public static FanartFactory getInstance() {
        if ( INSTANCE == null) {
            if ( Ortus.getInstance().modules.get("db") != null ) {
                INSTANCE = new FanartFactory(FFType.DB);
            } else {
                INSTANCE = new FanartFactory(FFType.Pheonix);
            }
        }
        return INSTANCE;
    }

    private FanartFactory(FFType fat)  {
	    if ( fat == FFType.DB)
		FAProvider = new ortustve.media.fanart.OrtusFanart();
	    else
		FAProvider = new ortustve.media.fanart.PhoenixFanart();
    }

    public IFanartProvider getProvider() {
        return FAProvider;
    }

}
